package com.ms.orm.exception;

/**
 * @author zdh
 */
public class BaseSqlException extends RuntimeException{

    protected static final String DefaultMsg = "[ERROR]";

    public BaseSqlException(){
        super(DefaultMsg);
    }

    public BaseSqlException(String message){
        super(message);
    }

    public BaseSqlException(String msg, Throwable cause) {
        super(msg, cause);
    }



    public static BaseSqlException formatMessage(String msg, Object... args) {
        String formatMsg = String.format(msg, args);
        return new BaseSqlException(formatMsg);
    }

    public static BaseSqlException formatMessage(Throwable cause, String msg, Object... args) {
        String formatMsg = String.format(msg, args);
        return new BaseSqlException(formatMsg, cause);
    }
}
